package boogui.admin;

import javax.swing.JComboBox;

import boogui.movie.MovieAreaVO;

public class MovieRegistryService {

	private MovieRegistryDAO md = null;
	private MovieRegistrySQL sql = null;

	public MovieRegistryService() {
		md = new MovieRegistryDAO();
		sql = new MovieRegistrySQL();
	}

	public void locationCombo(JComboBox c) {
		for (MovieAreaVO mv : md.allLocation()) {
			c.addItem(mv.getLocation());
		}
	}

	public void cinemaCombo(JComboBox c, String list) {
		for (MovieAreaVO mv : md.locationTheater(sql.getCinemaSQL(), list,
				"cinename")) {
			c.addItem(mv.getCinename());
		}
	}

	public void theaterCombo(JComboBox c, String list) {
		for (MovieAreaVO mv : md.locationTheater(sql.getTheaterSQL(), list,
				"theater")) {			
			c.addItem(mv.getTheater());
		}
	}
}
